<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class LaborExit extends Model
{
    use HasFactory;

    protected $fillable = [
        'labor_id',
        'company_id',
        'employment_form',
        'remuneration_method',
        'attendance_expenses',
        'exit_settle',
        'clothing_expenses',
        'safety_helmet',
        'confirm',
        'site_confirmation',
        'department',
        'reminders',
        'leaders_evaluation',
        'department_evaluation',
        'exit_date',
    ];
    const POSTONLY = [
        'labor_id',
        'company_id',
        'employment_form',
        'remuneration_method',
        'attendance_expenses',
        'exit_settle',
        'clothing_expenses',
        'safety_helmet',
        'confirm',
        'site_confirmation',
        'department',
        'reminders',
        'leaders_evaluation',
        'department_evaluation',
        'exit_date',
    ];

    protected function serializeDate(\DateTimeInterface $date)
    {
        return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
    }

    public function labor()
    {
        return $this->belongsTo(Labor::class);
    }
}
